<script language="javascript" src="webtoolkit.js"></script>
<script>
function startuploadphoto(){
    alert("validation");
}

function  completeuploadphoto(response){
    alert("server response:"+response);
    document.getElementById("response").innerHTML=response;
    
}

</script>
<form action="process.php" name="frmphoto" id="frmphoto" method="post" enctype="multipart/form-data" onSubmit="return AIM.submit(this, {'onStart' : startuploadphoto, 'onComplete' : completeuploadphoto})">
<div id="response"></div>
<input type="file" name="img" id="img" />
<input type="submit" name="submit" value="Click" />
</form>